//
//  GTextView.swift
//  Guardian
//
//  Created by hushaohua on 2017/8/22.
//  Copyright © 2017年 wallstreetcn. All rights reserved.
//

import Cocoa

class GTextView: NSTextView {

    override func draw(_ dirtyRect: NSRect) {
        super.draw(dirtyRect)

        // Drawing code here.
    }
    
    override var intrinsicContentSize: NSSize {
        guard let manager = textContainer?.layoutManager else {
            return .zero
        }
        
        manager.ensureLayout(for: textContainer!)
        
        return manager.usedRect(for: textContainer!).size
    }
    
}
